<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1{
            text-align: center;
        }
        div{
            width: 200px;
            height: 300px;
            position: relative;
            border-style: solid;
            border-width: 5px;
            border-color: blanchedalmond;
            border-radius: 10%;
            background-color: blanchedalmond;
            margin: auto;
            box-shadow: 5px 5px 10px 2px #969090;
        }
        .b{
            float: right;
            margin-top: 10px;
        }
    </style>
    <script>
        // var a = prompt('请输入数字a');
        // var b = prompt('请输入数字b');
        // var sum = a+b;
        // alert('求和的结果是：'+ sum);
        function sum (){
            var a = document.getElementById('num1').value;
            var b = document.getElementById('num2').value;
            var x = parseInt(a)+parseInt(b);
            alert('求和的结果是：'+ x);
        }
    </script>
</head>
<body>
    <h1>计算器求和操作</h1>
    <div>
        第一个数：<input type="text" id="num1"><br>
        第二个数：<input type="text" id="num2">
        <button onclick="sum()" class="b">求和</button>
    </div>
</body>
</html>